-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Add ability to control SSE request method and body #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for your interest and contribution. I do not have the capacity to review this PR quite yet, but I will get to it ASAP. |
i need this feature as well. when will it get merged? Thanks |
Hi! I also am working on something that could really benefit from this feature, thanks ^^ |
Went ahead and added support for PUT method as well: #64 Can we get a review on both PRs @keelerm84 if possible so we can get these features out? |
@Gao-Jun and @saada I have made some modifications to this PR. Instead of inferring the method from the presence of a payload, we are making those 2 separately provided items. This is more inline with some of our other event source SDKs. Additionally, the request payload can be either a simple static value, or the result of a executing some payload function. In a separate PR, I will introduce the ability to disable the retry functionality, which I also think should be explicitly defined rather than inferred. |
@keelerm84 Thank you for your work. |
I had mentioned above I would make a separate PR for that. Sorry I didn't have time to do it previously, but I have just merged it here. |
🤖 I have created a release *beep* *boop* --- ## [2.3.0](2.2.6...2.3.0) (2025-08-28) ### Features * Add ability to control SSE request method and body ([#51](#51)) ([7c65c4b](7c65c4b)) * Add ability to disable retries ([#67](#67)) ([f272b90](f272b90)) * Allow providing HTTP client option settings ([#68](#68)) ([1d9b31c](1d9b31c)) ### Bug Fixes * Handle redirect on 301 and 307 ([7d342e7](7d342e7)) * Pass through proxy user and password if present ([#69](#69)) ([0bb36f3](0bb36f3)) * Support field without colon in event ([7d342e7](7d342e7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Background
Recently, I'm working on an SSE client to Tencent LKE interface, which use a POST request and reply SSE AIGC content.
ruby-eventsource
is a good gem to handle SSE replies, but cannot send request via POST.Solution
This PR add a new param
payload
toinitialize
method. Some behaviors will be changed ifpayload
is set.payload
content